<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/categoryEntrance',
    'namespace' => 'Beerus\\Modules\\CategoryEntrance\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {

    $router->get('/', 'CategoryEntranceController@index');
    $router->get('/edit/{id?}', 'CategoryEntranceController@edit');
    $router->post('/save', 'CategoryEntranceController@save');
    $router->get('/state', 'CategoryEntranceController@state');
    $router->get('/offline', 'CategoryEntranceController@offLine');

    #前后台类目映射
    #前台类目排序
    $router->post('/sort', 'ClassifyMapController@sort');
    $router->post('/classifyMap/{classifyId}/sort', 'ClassifyMapController@sort');
    $router->post('/classifyMap/{classifyId}/edit/{secondCategoryId}/sort', 'ClassifyMapController@sort');
    #前台一级类目列表
    $router->get('/classifyMap', 'ClassifyMapController@list');
    #创建前台一级类目
    $router->get('/classifyMap/create', 'ClassifyMapController@classifyEdit');
    #编辑前台一级类目
    $router->get('/classifyMap/{firClassifyId}/edit', 'ClassifyMapController@classifyEdit');
    #删除前台一级类目
    $router->delete('/classifyMap/{classifyId}', 'ClassifyMapController@delClassify');
    #修改前台一级类目
    $router->put('/classifyMap/{classifyId}', 'ClassifyMapController@editClassify');
    #保存前台一级类目
    $router->post('/classifyMap/{firClassifyId}/save', 'ClassifyMapController@saveClassify');
    #创建前台二/三级类目
    $router->get('/classifyMap/{firClassifyId}/edit/create', [
        'uses' => 'ClassifyMapController@childClassifyEdit',
        'as' => '2'
    ]);
    $router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/create', [
        'uses' => 'ClassifyMapController@childClassifyEdit',
        'as' => '3'
    ]);
    #编辑前台二/三级类目
    $router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit', 'ClassifyMapController@childClassifyEdit');
    $router->get('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thridClassifyId}/edit', 'ClassifyMapController@childClassifyEdit');
    #修改前台二/三级类目
    $router->put('/classifyMap/{firClassifyId}/edit/{secClassifyId}', 'ClassifyMapController@editClassify');
    $router->put('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thridClassifyId}', 'ClassifyMapController@editClassify');
    #删除前台二/三级类目
    $router->delete('/classifyMap/{firClassifyId}/edit/{secClassifyId}', 'ClassifyMapController@delClassify');
    $router->delete('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thridClassifyId}', 'ClassifyMapController@delClassify');
    #保存前台二/三级类目
    $router->post('/classifyMap/{firClassifyId}/edit/{secClassifyId}/save', 'ClassifyMapController@saveChildClassify');
    $router->post('/classifyMap/{firClassifyId}/edit/{secClassifyId}/edit/{thridClassifyId}/save', 'ClassifyMapController@saveChildClassify');


    # 分类wiki管理
    $router->get('categorywikilist', 'CategoryWikiControllerCard@index');
    $router->get('categorywikilist/create', 'CategoryWikiControllerCard@create');
    $router->post('categorywikilist/update', 'CategoryWikiControllerCard@update');
    $router->delete('categorywikilist/{id}', 'CategoryWikiControllerCard@delete');
    $router->get('categorywikilist/getbasicinfo', 'CategoryWikiControllerCard@getBasicInfo');

    //后端分类搜索关键词
    $router->get('searchkeywords', 'CategorySearchKeywordsController@index');
    $router->get('searchkeywords/create', 'CategorySearchKeywordsController@edit');
    $router->get('searchkeywords/{id}/edit', 'CategorySearchKeywordsController@edit');
    $router->post('searchkeywords/save', 'CategorySearchKeywordsController@save');
    $router->delete('searchkeywords/{id}', 'CategorySearchKeywordsController@del');
});